<?php echo $this->element('body_help');?>
<div class="wrap">
<div id="icon-users" class="icon32"><br></div>
<h2>
	<?php __('Nhóm : '.$group['Group']['name']);?>
	<a class="button add-new-h2" href="<?php echo $this->webroot;?>users/set_add/<?php echo $group['Group']['id'];?>"><?php __('Thêm mới người dùng');?></a>
</h2>
<?php echo $this->Session->flash();?>
<br/>


<?php if(!empty($group['User'])){ ?>
<table class="wp-list-table widefat fixed users" cellspacing="0">
	<thead>
		<tr>
			<th scope="col" id="cb" class="manage-column column-cb check-column" style=""><input type="checkbox"></th>
			<th scope="col" id="name" class="manage-column column-name sortable desc" style="">
				<span><?php echo $this->Paginator->sort('Tên đăng nhập','username');?></span></th>
			<th style="" class="manage-column column-name sortable asc" id="name" scope="col">
				<span><?php echo $this->Paginator->sort('Tên người dùng','name');?></span></th>
			<th style="" class="manage-column column-email sortable asc" id="email" scope="col">
				<span><?php echo $this->Paginator->sort('Email','email');?></span></th>
			<th style="" class="manage-column column-date sortable asc" id="phone" scope="col">
				<span><?php echo $this->Paginator->sort('Phone','phone');?></span></th>
			<!--<th style="" class="manage-column column-date sortable asc" id="date" scope="col">
				<span><?php echo $this->Paginator->sort('Lớp','class_student');?></span></th>
			-->
			<th style="" class="manage-column column-date sortable asc" id="group" scope="col">
				<span><?php echo $this->Paginator->sort('Nhóm sử dụng','group_id');?></span></th>
			
			<th style="" class="manage-column column-date sortable asc" id="date" scope="col">
				<span><?php echo $this->Paginator->sort('Ngày sửa','modified');?></span></th>
				
		</tr>
	</thead>

	<tfoot>
		<tr>
			<th scope="col" id="cb" class="manage-column column-cb check-column" style=""><input type="checkbox"></th>
			<th scope="col" id="username" class="manage-column column-name sortable desc" style="">
				<span><?php echo $this->Paginator->sort('Tên đăng nhập','username');?></span></th>
			<th style="" class="manage-column column-name sortable asc" id="name" scope="col">
				<span><?php echo $this->Paginator->sort('Tên người dùng','name');?></span></th>
			<th style="" class="manage-column column-email sortable asc" id="email" scope="col">
				<span><?php echo $this->Paginator->sort('Email','email');?></span></th>
			<th style="" class="manage-column column-date sortable asc" id="phone" scope="col">
				<span><?php echo $this->Paginator->sort('Phone','phone');?></span></th>
			<!--<th style="" class="manage-column column-date sortable asc" id="date" scope="col">
				<span><?php echo $this->Paginator->sort('Lớp','class_student');?></span></th>
				-->
			<th style="" class="manage-column column-date sortable asc" id="group" scope="col">
				<span><?php echo $this->Paginator->sort('Nhóm sử dụng','group_id');?></span></th>
			<th style="" class="manage-column column-date sortable asc" id="date" scope="col">
				<span><?php echo $this->Paginator->sort('Ngày sửa','modified');?></span></th>
				
		</tr>
	</tfoot>
	<tbody id="the-list" class="list:user">
		
		<?php 
			$i = 0;
			foreach ($group['User'] as $user):
				$class = null;
				if ($i++ % 2 == 0) {
					$class = ' class="alternate"';
				}
				$id= $user['id'];
			?>
			<tr <?php echo $class;?>>
				<th scope="row" class="check-column"><input name="user_<?php echo $id;?>" id="user_<?php echo $id;?>" class="contributor" value="<?php echo $id;?>" type="checkbox"></th>
				<td class="username column-username">
					<img id="user_icon" alt="" src="<?php echo $this->webroot;?>img/images_uses_green.png" class="avatar avatar-32 grav-hashed grav-hijack" height="32" width="32">
					<strong><?php echo $user['username']; ?>&nbsp;</strong><br>
					<div class="row-actions">
						<span class="remove">
							<?php echo $this->Html->link(__('Xem', true), array('controller'=>'users','action' => 'view', $user['id'])); ?>
						</span>&nbsp;|&nbsp;
						<span class="remove">
							<?php echo $this->Html->link(__('Sửa', true), array('controller'=>'users','action' => 'edit', $user['id'])); ?>
						</span>|&nbsp;
						<span class="remove">
							<?php echo $this->Html->link(__('Xóa', true), array('controller'=>'users','action' => 'delete', $user['id']), null, sprintf(__('Có muốn xóa # %s?', true), $user['name'])); ?>
						</span>
					</div>
				</td>
				<td class="username column-name">
					<strong><?php echo $user['name']; ?>&nbsp;</strong>
				</td>
				<td class="eamil column-email">
					<?php echo $user['email']; ?>&nbsp;
				</td>
				<td class="phone column-phone">
					<?php echo $user['phone']; ?>&nbsp;
				</td>
				<!--<td class="name column-name">
					<?php echo $user['class_student']; ?>&nbsp;
				</td>-->
				<td class="name column-name">
					<?php echo $this->Html->link($group['Group']['name'], array('controller' => 'groups', 'action' => 'view', $group['Group']['id'])); ?>&nbsp;
				</td>
				
				<td class="date column-date">
					<abbr title="<?php echo $user['modified']; ?>"><?php echo $user['modified']; ?>&nbsp;</abbr>
				</td>
				
				
			
			</tr>
		<?php endforeach;?>
		
	</tbody>
	
</table>

<div class="tablenav bottom">
	<div class="alignleft actions">
		<select name="action2">
			<option value="-1" selected="selected">Tác vụ</option>
			<option value="remove">Xóa</option>
		</select>
		<input name="" id="doaction2" class="button-secondary action" value="Thực hiện" type="submit">
	</div>
	<div class="tablenav-pages">
	<span class="displaying-num"><?php
	echo $this->Paginator->counter(array(
	'format' => __('Trang %page% của %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
	));
	?></span>
	<a href="#" title="Go to the first page" class="first-page"><?php echo $this->Paginator->prev(__('<<', true), array(), null, array('class'=>'disabled'));?></a>
	<span class="paging-input">| 	<?php echo $this->Paginator->numbers();?>
 |</span></span>
	<a href="#" title="Go to the last page" class="last-page"><?php echo $this->Paginator->next(__('>>', true), array(), null, array('class' => 'disabled'));?></a>
	</div>
</div>
<br/>
<a class="button add-new-h2" href="<?php echo $this->webroot;?>users/add"><?php __('Thêm mới người dùng');?></a>
<?php } else{ ?>
			<div class="message" id="flashMessage">
				Chưa có người dùng ở đây &nbsp;&nbsp;
				<a  href="<?php echo $this->webroot;?>groups"><?php __('<b>Quản lý nhóm người dùng</b>');?></a>
				&nbsp;|&nbsp;
				<a  href="<?php echo $this->webroot;?>users/set_add/<?php echo $group['Group']['id'];?>"><?php __('<b>Thêm mới người dùng</b>');?></a>
			</div>
<?php	};?>
<!--
	<div class="related">
	<h3><?php __('Related Option Permissions');?></h3>
	<?php if (!empty($group['OptionPermission'])):?>
	<table cellpadding = "0" cellspacing = "0">
	<tr>
		<th><?php __('Id'); ?></th>
		<th><?php __('Option Id'); ?></th>
		<th><?php __('Group Id'); ?></th>
		<th><?php __('Value Controller'); ?></th>
		<th><?php __('Avtive'); ?></th>
		<th><?php __('Created'); ?></th>
		<th class="actions"><?php __('Actions');?></th>
	</tr>
	<?php
		$i = 0;
		foreach ($group['OptionPermission'] as $optionPermission):
			$class = null;
			if ($i++ % 2 == 0) {
				$class = ' class="altrow"';
			}
		?>
		<tr<?php echo $class;?>>
			<td><?php echo $optionPermission['id'];?></td>
			<td><?php echo $optionPermission['option_id'];?></td>
			<td><?php echo $optionPermission['group_id'];?></td>
			<td><?php echo $optionPermission['value_controller'];?></td>
			<td><?php echo $optionPermission['avtive'];?></td>
			<td><?php echo $optionPermission['created'];?></td>
			<td class="actions">
				<?php echo $this->Html->link(__('View', true), array('controller' => 'option_permissions', 'action' => 'view', $optionPermission['id'])); ?>
				<?php echo $this->Html->link(__('Edit', true), array('controller' => 'option_permissions', 'action' => 'edit', $optionPermission['id'])); ?>
				<?php echo $this->Html->link(__('Delete', true), array('controller' => 'option_permissions', 'action' => 'delete', $optionPermission['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $optionPermission['id'])); ?>
			</td>
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>

	<div class="actions">
		<ul>
			<li><?php echo $this->Html->link(__('New Option Permission', true), array('controller' => 'option_permissions', 'action' => 'add'));?> </li>
		</ul>
	</div>
</div>
</div>

-->
<br class="clear">
<div class="clear"></div>
</div><!-- wrap -->